package algorithm.二分;

import java.util.Optional;
import java.util.function.Function;

public interface tmp {
    default <S,T> Function<Optional<S>,Optional<T>> fMap(Function<S,T> function) {
        Function<Optional<S>,Optional<T>> freeFunction = input-> {
            return input.isPresent()?Optional.of(function.apply(input.get())):Optional.empty();
        };
        return freeFunction;
    }
}
